<?php
    require('./Utils.php');

    $post = getJsonParamter();

    $username = $_GET['username'];

    $conn = getConnection();
    $sql = "SELECT username FROM user WHERE username = ?";

    $result = query($conn, $sql, $username);

    if($result['username']){
        getJson(500, '用户名已被占用', null);
    }else{
        getJson(200, '用户名可以使用', null);
    }
?>